<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="br.fatec.ads.model.Cliente"%>
<%@ page import="java.util.List" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<html>
<script>
	var mensagem = '<%= request.getParameter("mensagem") %>';
	
	if(mensagem != "null" && mensagem != ""){
		alert(mensagem);
	}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/displaytag.css" /> 
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/telas.css" />
<title>Cadastro de Cliente - Pesquisa</title>
</head>
<%
	if(request.getSession(false).getAttribute("idUsuario") == null){
		request.getRequestDispatcher("login.jsp").forward(request, response);
		return;
	}

	Cliente clientePesq = new Cliente();
	if(request.getSession(false).getAttribute("clientePesq") != null){
		clientePesq = (Cliente) request.getSession(false).getAttribute("clientePesq");
	}
%>
<body>
	<jsp:include page="<%= request.getSession(false).getAttribute(\"menuSistema\").toString() %>" flush="false"/>
	<div class="formulario" style="position: absolute; left: 38px; top: 130px; width: 850px; height: 150px;">
		<label style="position: absolute; left: 300px; top: -20px;">Cadastro de Cliente - Pesquisa</label>
		<form name="Form1" method="post" action="ClientePesquisar" id="Form1">
			<div style="position: absolute; left: 40px; top: 20px; width: 200px; height: 16px;">
				<span style="color: #000000;">Nome Cliente</span>
			</div>
			<input type="text" class="input_txt"
				style="position: absolute; left: 40px; top: 40px; width: 400px; height: 19px; line-height: 19px;"
				name="txtNomeCliente" tabindex="1" maxlength="255"
				value="<%= clientePesq.getNomeCliente() == null ? "" : clientePesq.getNomeCliente() %>"/>
			
			<input type="submit" class="button" name="btnPesquisar" value="Pesquisar"
				style="position: absolute; left: 305px; top: 100px; width: 100px; height: 25px;">
			<input type="button" class="button" name="btnIncluir" value="Incluir"
				style="position: absolute; left: 445px; top: 100px; width: 100px; height: 25px;" onclick="window.location='ClienteIncluir'">
			
			<div style="position: absolute; top: 155px; width: 850px;">
				<display:table id="row" name="sessionScope.listaCliente" pagesize="10" class="dataTable"
					decorator="br.fatec.ads.decorator.ClienteDecorator">
					<display:setProperty name="paging.banner.placement" value="bottom"/>
					<display:column property="idCliente" title="ID" style="width: 40px; text-align: center;"/>
					<display:column property="nomeCliente" title="Cliente"/>
					<display:column property="linkClienteConsultar" title="" style="width: 40px; text-align: center;"/>
					<display:column property="linkClienteAlterar" title="" style="width: 40px; text-align: center;"/>
					<display:column property="linkClienteExcluir" title="" style="width: 40px; text-align: center;"/>
				</display:table>
			</div>
		</form>
	</div>
</body>
</html>